import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtQuick.Shapes 1.15

MainView {
    id: root
    width: 800
    height: 391
    GridLayout{ //root中放置一个行布局，布局中放置3个方块
        id: languagelayout
        anchors.centerIn: parent
        columnSpacing: 20 //间距
        rows: 1 //行数
        columns: 2 //列数

        Button
        {
            id:btnLanguage
            x: 192
            y: 74
            Layout.preferredWidth: 185
            Layout.preferredHeight: 85
            background: Rectangle{
                border.width: 0
                color: "#7584C2"
                    }

            text: qsTr("语言")
            font.pixelSize: 25
            palette.buttonText: "white"
            onClicked: {
                myLoader.source="LanguagePanel.qml"
            }
        }

        Button
        {
            id:btnEnglish
            x: 431
            y: 213
            Layout.preferredWidth: 185
            Layout.preferredHeight: 85
            background: Rectangle{
                border.width: 0
                color: "#7584C2"
                    }

            text: qsTr("日期")
            font.pixelSize: 25
            palette.buttonText: "white"
            onClicked: {
                myLoader.source="DatePanel.qml"
            }
        }
//        Button
//        {
//            id:btnIndonesian
//            x: 431
//            y: 213
//            Layout.preferredWidth: 185
//            Layout.preferredHeight: 85
//            background: Rectangle{
//                border.width: 0
//                color: "#7584C2"
//                    }

//            text: "Indonesia"
//            font.pixelSize: 25
//            palette.buttonText: "white"
//            onClicked: {
//                if(loaderText.visible)
//                {
//                    return;
//                }
//                loaderText.visible=true;
//                language = 2;
//                funcTimer.start();
//            }
//        }
    }
    Button
    {
        id:btnReturn
        x: 688
        y: 281
        //x: 675
        //y: 20
        width: 100
        height: 100
        background: Rectangle{
            border.width: 0
            color: "#B0B0D0"
                }

        text: qsTr("返回")
        font.pixelSize: 25
        palette.buttonText: "white"
        onClicked: {
            bottomBar.selected=4
//            myLoader.visible=false;
//            myLoader.visible=true
            myLoader.source="SettingsPanel.qml"
        }
    }
//    BusyIndicator {
//        id: languageLoader
//        width: 120
//        height: 120
//        anchors.centerIn: parent
//        running: mytables.saveOK===2
//        visible: mytables.saveOK===2
//        z:1000
//        Component.onCompleted: {
//            contentItem.pen = "#40A0A0"
//            contentItem.fill = "#40A0A0"
//        }
//    }
    Dialog {
        anchors.centerIn: parent
        id: languageSaveOKDialog
        //title: "提示"
        standardButtons: Dialog.Ok
        //title:qsTr("保存成功！")
        modal: true
        closePolicy: "CloseOnEscape"
 //       onAccepted: {
 //           normalParaSaveOKDialog.close()
 //           rectangle.selectedView = 0;
 //           bottomBar.selected = 0;
 //       }
        z:100
        //onRejected: console.log("Cancel clicked")
    }
}


